package com.gzc.pm.logic
{
	import cn.skyclass.events.SubmitEvent;
	import cn.skyclass.net.BaseSubmitter;
	import cn.skyclass.net.OperationResult;
	
	import com.gzc.pm.dao.CplAxleDao;
	
	import mx.collections.ArrayCollection;
	import mx.rpc.events.ResultEvent;
	
	public class CplAxleEditor extends BaseSubmitter
	{
		public function CplAxleEditor(name:String, lines:ArrayCollection)
		{
			_name = name;
			_lines = lines;
		}
		
		private var _name:String;
		private var _lines:ArrayCollection;
		public var result:OperationResult;
		
		override protected function doSubmit():void{
			var cplAxleDao:CplAxleDao = new CplAxleDao();
			cplAxleDao.addAxle(_name, _lines,  onSubmitted);
		}
		
		private function onSubmitted(e:ResultEvent):void{
			result = e.result as OperationResult;
			
			dispatchSubmittedEvent();
		}
		
	}
}